home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / VIVIDUS / QD3D.SIT / qd3d / geometry.h < prev    next >
Text File  |  1991-10-09  |  1KB  |  42 lines

  1. /*    ======================================================================
  2.  
  3.     This header file is Copyright 1991 by Vividus Consulting.
  4.     
  5.     This is not public domain source code.  You may not copy and
  6.     paste from this source code.  Read your Vividus Licensing
  7.     agreement for details and other restrictions.
  8.  
  9.     Note:    At present, these routines are only supported as needed by
  10.             hedra.
  11.  
  12.     ======================================================================    */
  13.  
  14. #ifndef    _geometry_
  15. #define    _geometry_
  16.  
  17. typedef    struct {
  18.     vector    b;            //    Origin of ray.
  19.     vector    m;            //    Direction of ray.
  20. } Ray;
  21.  
  22. typedef struct {
  23.     vector    center;        //    Ellipsoid center.
  24.     vector    dimensions;    //    Ellipsoid dimensions.
  25. } Ellipsoid;
  26.  
  27. typedef struct {
  28.     vector    pt;            //    Point on plane.
  29.     vector    normal;        //    Normal of plane.
  30. } Plane;
  31.  
  32. typedef struct {
  33.     vector    max;        //    Point in 1st octant direction.
  34.     vector    min;        //    Point in opposite octant direction.
  35. } Bound3dBox;
  36.  
  37. Boolean    PtInPoly(vector *pt, int n, vector verts[], vector *norm);
  38. Boolean    RayXPlane(Ray *r, Plane *p, double *t, vector *pt);
  39. int        RayXEllipsoid(Ray *r, Ellipsoid *e, double *t);
  40. void    EllipsoidFromBox(Bound3dBox *bb, Ellipsoid *e);
  41.  
  42. #endif    _geometry_